-- card: 59075 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 4755 -- name: -- part contents for background part 4 ----- text ----- A few comments about this example: the sizeof operator in ANSI C produces a value whose type is size_t. However in Think C 4.0 its type is simply int. Here this does not cause difficulties since the prototype for malloc() enforces the necessary type conversion. Also note that a cast operator* is used to convert the void pointer returned by malloc to the desired type. This is not strictly necessary since automatic type conversion will take place upon assignment. Dynamic memory allocation is often used when the amount of memory needed by an application is not known before run-time. The program may define a large array of pointers to data structures, but dynamically allocate the individual data structures pointed to by elements of the array only as needed: struct personnel_rec *person_array[1000]; /* doesn't yet allocate any . personnel_rec's */ . person_array[i] = malloc(sizeof (struct personnel_rec)); /* allocate ith element */ -- part contents for background part 7 ----- text ----- 199 -- part contents for background part 29 ----- text ----- 47191 -- part contents for background part 27 ----- text ----- Casts for type conversion -- part contents for background part 20 ----- text ----- Casts for type conversion - p150